﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Admin/Views/Shared/AdminMaster.Master" Inherits="System.Web.Mvc.ViewPage<VietThuongLMS.Areas.Admin.Models.GhiChuModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
<script type="text/javascript" src="<%: Url.Content("~/Scripts/MicrosoftAjax.js") %>"></script>
    <script type="text/javascript" src="<%: Url.Content("~/Scripts/MicrosoftMvcValidation.js") %>"></script>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.js"></script>
    <script type="text/javascript" src="<%: Url.Content("~/Plugins/ckeditor/ckeditor.js") %>"></script>
    
    <legend>
        Thêm mới Ghi Chú
    </legend>
    <input hidden id="checkpoint" type="checkbox" disabled/>
    <% Html.EnableClientValidation();
       using (Html.BeginForm("Create", "GhiChu", new { area = "Admin", maNhanVien = ViewData["maNhanVienR"] }, FormMethod.Post, new { @class = "form-horizontal", @id = "formNew", @name = "formNew", enctype = "multipart/form-data" }))
       {
    %>
        <input type="hidden" id="hCheckedBook" name="hCheckedBook" />

        <%: Html.ValidationSummary(true) %>

        
          <div class="control-group">
                <label class="control-label" for="strFrom">
                    Tiêu Đề<span class="field-validation-error" >(*)</span></label>
                <div class="controls">
                    <%: Html.TextBoxFor(t => t.tieuDe, new { @class = "h30 span12", placeholder = "Tiêu đề..." })%>
                    <%: Html.ValidationMessageFor(m => m.tieuDe)%>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="strFrom">
                    Nội dung</label>
                <div class="controls">
                    <%: Html.TextAreaFor(t => t.noiDung, new { @class = "ckeditor", placeholder = "Nội dung..." })%>
                    <%: Html.ValidationMessageFor(m => m.noiDung)%>
                </div>
            </div>

            <div class="control-group">
                <div class="controls">
                    <button id="btnCreate" name="btnCreate" type="submit" class="btn btn-primary"><i class="icon-plus icon-white"></i>Tạo Ghi Chú</button>
                </div>
            </div>
        

    <% } %>

    <div class="btn btn-primary">
        <a href="<%=ResolveUrl("~/Admin/GhiChu/Index") %> ">
        <button class="btn btn-primary">
        <i class="icon-reply"></i>
            Quay lại danh sách
        </button></a>
    </div>

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">

    <script type="text/javascript">

        function check_invalid() {
            var username = $('#TaiKhoan_MaTaiKhoan').val();
            $.ajax({
                url: '<%: Url.Action("CheckValid")%>',
                data: { 'username': username },
                type: "post",
                cache: false,
                success: function (msg) {
                    if (msg == "False") {
                        $('#checkpoint').prop('checked', false);
                        alert("Mã Loại Tài Khoản Không Được Trống");
                    }
                    else if (msg == "True")
                        $('#checkpoint').prop('checked', true);
                },
                error: function (xhr, ajaxOptions, thrownError) {
                    alert("fail");
                }
            });
        }
    </script>

</asp:Content>

